﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class MenuUIController : MonoBehaviour {

	public Toggle Sound;
	public Animator anim_start;
    public Animator anim_setting;
    public Animator anim_pa_setting;

    public void StartGame()
	{
		Debug.Log("Start Game...");
		SceneManager.LoadScene("mouse");
	}
	public void VolumeChanged(float vol)
	{
		//if (vol==0)
		//{
		//	Sound.isOn = true;
		//}
		//else
		//{
		//Sound.isOn = false;
	    //}
	    Sound.isOn=vol==0?true:false;
	}
	public void OpenSettings()
	{
		//Debug.Log("Settings");
		anim_pa_setting.enabled=true;
		anim_setting.enabled=true;
		anim_start.enabled=true;
		//动画状态参数切换
		anim_start.SetBool("Startbol", false);
		anim_setting.SetBool("SettingBol", false);
		anim_pa_setting.SetBool("Slide in", false);
	}
	public void CloseSettings()
	{
		anim_start.SetBool("Startbol",true);
		anim_setting.SetBool("SettingBol", true);
		anim_pa_setting.SetBool("Slide in",true);
	}
}
